<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ page import="com.grep.extra.dao.impl.TaskDAOSQL,com.grep.base.util.PinYin4jUtil,com.grep.base.util.UUIDGenerator,com.grep.extra.dao.impl.ContentParseDao" %>
<%
	request.setCharacterEncoding("UTF-8");
	 

	String id = UUIDGenerator.getUUID();
	String siteId = request.getParameter("siteid");
	String taskName = request.getParameter("taskname");
	String taskDesc = request.getParameter("taskdesc");
	String taskPolicy = request.getParameter("taskpolicy");
	String taskAnalyse = request.getParameter("taskanalyse");
	TaskDAOSQL taskDaoSql = new TaskDAOSQL();
	ContentParseDao contentParse = new ContentParseDao();
	if (taskName != null) {
		String taskEnName = PinYin4jUtil.getPinyin(taskName);
		String insertSiteTaskSql = "insert into site_tasks(id,site_id,task_name,task_desc,task_policy,task_analyse,task_enname) values('"
				+ id
				+ "','"
				+ siteId
				+ "','"
				+ taskName
				+ "','"
				+ taskDesc
				+ "','"
				+ taskPolicy
				+ "','"
				+ taskAnalyse
				+ "','"
				+ taskEnName + "')";
				
		boolean issuccess = taskDaoSql.insertTask(insertSiteTaskSql);
		contentParse.addContentParse(taskName);
		if(issuccess){
			response.getWriter().println("任务添加成功");	
		}else{
			response.getWriter().println("任务添加失败");
		}
	}

%>